#include<iostream>

int main(){
    using namespace std;
    double wages[3] = {10000.0, 20000.0, 30000.0};
    short stacks[3] = {3, 2, 1};

    double * pw = wages; // 数组名就是数组地址
    short * ps = &stacks[0];  // 数组首元素的地址 就是数组地址

    cout << "pw = " << pw << ", *pw = " << *pw << endl;
    pw = pw +1;
    cout << "add 1 to the pw pointer:\n";
    cout << "pw = " << pw << ", *pw = " << *pw << endl;

    ps = ps +1;
    cout << "add 1 to the ps pointer:\n";
    cout << "ps = " << ps << ", *ps = " << *ps << "\n\n";

    cout << "access two element with array notation\n";
    cout << "stack[0] = " << stacks[0]
         << ", stack[1] = " << stacks[1] << endl;
    cout << "access two elements with pointer notation\n";
    cout << "*stack = " << *stacks
        << ", *(stacks + 1) = " << *(stacks + 1) << endl;

    cout << sizeof(wages) << " = size of wages array\n";
    cout << sizeof(pw) << " = siz of pw pointer\n";

    return 0;
}